from ctypes import windll


class Variable:
    handle = windll.user32.FindWindowW(None, "逍遥模拟器")
    # 模拟器宽高,不能改
    width = 870
    height = 498
    # 电脑缩放比
    scale = 2
    # 体力不足时是否购买体力
    addTili = True
    # 宿舍
    dorm = {
        # 是否开启
        "open": True,
        # [基地1的房间数,基地2的房间数,..]
        "room": [6, 2],
        "执勤": True,
        "一键代工": True,
        "produce": True,
        # 桌子，挂饰, 椅子, 物件
        "produce_type": ["桌子"],
        # 领取奖励
        "receive_reward": True,
    }
    # 更多的角色可自行截图放入，默认：邦比娜塔, 红莲，瑰丽
    # person字段需按顺序
    fight_roles = {"open": False, "person": ["邦比娜塔", "红莲"]}
    # 战区,number:送死刷图次数,6次可刷满,不需要则设为0
    fight_one = {"open": False, "number": 6}
    # 囚笼
    fight_two = {"open": False}
    # 宣叙妄想,number:节点数量
    fight_three = {"open": True, "number": 10}

    @staticmethod
    def init(dict):
        for i, j in dict.items():
            if i == "handle":
                Variable.handle = windll.user32.FindWindowW(
                    None, "逍遥模拟器" if j == "" else j
                )
                continue
            exec(f"Variable.{i} = {j}")
